package net.hn.hnms.biz.plan.enums;

import lombok.Getter;

@Getter
public enum PostTypeEnum {
    // 1.副总工程师，2.副矿长，3.矿总工程师，4.工会主席，5.纪委书记,6.矿长，7.党委书记
    FZGCS("1", "副总工程师",8,Integer.MAX_VALUE),
    FKZ("2", "副矿长",7,Integer.MAX_VALUE),
    KZGCS("3", "矿总工程师",5,5),
    GHZX("4", "工会主席",8,8),
    JWSJ("5", "纪委书记",5,5),
    KZ("6", "矿长",5,5),
    DWSJ("7", "党委书记",5,5);

    private String code;
    private String desc;
    private Integer minShifts;
    private Integer maxShifts;


    PostTypeEnum(String code, String name,Integer minShifts,Integer maxShifts) {
        this.code = code;
        this.desc = name;
        this.minShifts = minShifts;
        this.maxShifts = maxShifts;
    }

    public static String getDesc(String code) {
        for (PostTypeEnum postTypeEnum : PostTypeEnum.values()) {
            if (postTypeEnum.getCode().equals(code)) {
                return postTypeEnum.getDesc();
            }
        }
        return null;
    }

    public static Integer getMinShifts(String code) {
        for (PostTypeEnum postTypeEnum : PostTypeEnum.values()) {
            if (postTypeEnum.getCode().equals(code)) {
                return postTypeEnum.getMinShifts();
            }
        }
        return 0;
    }

    public static Integer getMaxShifts(String code) {
        for (PostTypeEnum postTypeEnum : PostTypeEnum.values()) {
            if (postTypeEnum.getCode().equals(code)) {
                return postTypeEnum.getMaxShifts();
            }
        }
        return 0;
    }

}
